package com.taoym.voucher.common.enums;

import lombok.Getter;

/**
 * @coder taoym
 * @datetime 2021/6/11 22:08
 * @desc 活动订单状态
 */
@Getter
public enum ActivityOrderStatusEnum implements EnumsCommon {

    NOT_PAY(0, "#909399", "未付款"),
    IS_PAY(1, "#0192ff", "已付款"),
    WAIT_SETTLEMENT(2, "#ffd100", "待结算"),
    IS_SETTLEMENT(3, "#68c632", "已结算"),
    INVALID_ORDER(4, "#f20108", "无效订单"),
    ;

    private final Integer code;
    private final String color;
    private final String msg;

    ActivityOrderStatusEnum(Integer code, String color, String msg) {
        this.code = code;
        this.color = color;
        this.msg = msg;
    }

    public static String getMsg(Integer code) {
        for (ActivityOrderStatusEnum value : values()) {
            if (code.equals(value.code)) {
                return value.msg;
            }
        }
        return null;
    }

    public static String getColor(Integer code) {
        for (ActivityOrderStatusEnum value : values()) {
            if (code.equals(value.code)) {
                return value.color;
            }
        }
        return null;
    }
}
